﻿using CodeMan.Application.Contracts.ClassGens;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CodeManDesktopBlazor.BlazorComponents.Models
{
    public class CodeManGenUI<K, T>
        where K : ClassGenDTOCreateUpdate
        where T : ClassAttributeDTO
    {
        public K classGenDTO { get; set; } = default(K);
        public List<T> classAttributeDTOLst { get; set; } = new List<T>();

        public string InputContent { get; set; }
        public string InputContentAtt
        {
            get
            {
                if (classAttributeDTOLst.HasItem())
                {
                    return classAttributeDTOLst.Select(a => a?.AName).Aggregate((a, b) => $"{a},{b}");
                }
                return "";
            }
        }
    }
}
